import java.math.BigInteger;
 
public class test {
    public static void main(String[] args) {
        //BigInteger p=BigInteger.valueOf(2579L);
        System.out.println("initial...");
        BigInteger p=new BigInteger("2579");
        BigInteger alpha=new BigInteger("2");
        BigInteger d=new BigInteger("765");//sk
        EIG elGamalDemo=new EIG(p,alpha,d);
 
        System.out.println("System Parameter...");
        System.out.println("p="+elGamalDemo.p);
        System.out.println("alpha="+elGamalDemo.alpha);
        System.out.println("d="+elGamalDemo.getD());
        System.out.println("y="+elGamalDemo.y);
 
        BigInteger M=new BigInteger("2023");
        BigInteger k=new BigInteger("853");
        System.out.println("M="+M);
 
        System.out.println("Encrypt...");
        BigInteger[] C=elGamalDemo.encrypt(M,k);
        System.out.print("After encryption : ");
        System.out.println(C[0]+" "+C[1]);
 
        BigInteger newM=elGamalDemo.decrypt(C);
        System.out.println("Decrypt...");
        System.out.print("After decryption : ");
        System.out.println(newM);
 
    }
}